<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:p="http://thymeleafexamples">
<body>
<div class="form-body">
    <div class="form-group" th:each="groupAuthority : ${groupAuthorities}">
        <label th:text="${groupAuthority.groupName}"></label>
        <div class="checkbox-list">
            <label class="checkbox-inline" th:each="authority,stat : ${groupAuthority.authorities}">
                <input type="checkbox" name="rightIds"
                       th:value="${authority.key}"
                       th:text="${authority.value}"
                       th:checked="${#lists.contains(selected,authority.key)}"/>
            </label>
        </div>
    </div>
</div>
</body>
</html>